/**
 * @author thaodo
 *
 *
 */
package com.mfsoft.adapter;

import com.mfsoft.fragment.ImageServerFragment;
import com.mfsoft.fragment.MyAlbumFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class TabsPageAdapter extends FragmentPagerAdapter{
	MyAlbumFragment albumFragment;
	ImageServerFragment imageServerFragment;

	public TabsPageAdapter(FragmentManager fm) {
		super(fm);
		albumFragment = new MyAlbumFragment();
		imageServerFragment = new ImageServerFragment();
	}

	@Override
	public Fragment getItem(int index) {
		switch (index) {
		case 0://my album
//			return new MyAlbumFragment();
			return albumFragment;
		case 1://server
//			return new ImageServerFragment();
//			imageServerFragment.openNetworkSetting();
			return imageServerFragment;
		}
		return null;
	}

	public MyAlbumFragment getAlbumFragment() {
		return albumFragment;
	}

	public void setAlbumFragment(MyAlbumFragment albumFragment) {
		this.albumFragment = albumFragment;
	}

	public ImageServerFragment getImageServerFragment() {
		return imageServerFragment;
	}

	public void setImageServerFragment(ImageServerFragment imageServerFragment) {
		this.imageServerFragment = imageServerFragment;
	}

	@Override
	public int getCount() {
		//so luong tabs
		return 2;
	}

}
